{include file="index/header"}
<body>
<div class="fly-panel fly-panel-user">
    <div class="tpt-admin">
        <fieldset class="layui-elem-field layui-field-title">
            <legend>修改采集器</legend>
        </fieldset>
        <form class="layui-form">
            <input type="hidden" name="id" value="{$shoppingGuideItem.id}">
            <!-- 采集器名称 -->
            <div class="layui-form-item">
                <label class="layui-form-label">采集器名称</label>
                <div class="layui-input-block">
                    <input type="text" name="name" value="{$shoppingGuideItem.name}" required lay-verify="required" placeholder="必填内容" autocomplete="off" class="layui-input">
                </div>
            </div>
            <!-- 关键词 -->
            <div class="layui-form-item">
                <label class="layui-form-label">关键词</label>
                <div class="layui-input-block">
                    <input type="text" name="keyword" value="{$shoppingGuideItem.keyword}" required lay-verify="required" placeholder="必填内容" autocomplete="off" class="layui-input">
                </div>
            </div>
            <!-- 采集分类ID -->
            <div class="layui-form-item">
                <label class="layui-form-label">采集分类ID</label>
                <div class="layui-input-block">
                    <input type="text" name="catIds" value="{$shoppingGuideItem.catIds}" placeholder="后台类目ID，用,分割，最大10个，该ID可以通过taobao.itemcats.get接口获取到" autocomplete="off" class="layui-input">
                </div>
            </div>
            <!-- 入库分类 -->
            <div class="layui-form-item" style="width: 300px;">
                <label class="layui-form-label">入库分类</label>
                <div class="layui-input-block">
                    <select name="cid">
                        {volist name="CategoryList" id="vo"}
                        <option {if condition="$shoppingGuideItem['cid'] eq $vo['id']"}selected="selected"{/if} value="{$vo.id}">{$vo.name}</option>
                        {/volist}
                    </select>
                </div>
            </div>
            <!-- 排序方式 -->
            <div class="layui-form-item" style="width: 300px;">
                <label class="layui-form-label">排序方式</label>
                <div class="layui-input-block">
                    <select name="sort">
                        <option value=" ">综合排序</option>
                        <option {if condition="$shoppingGuideItem['sort'] eq 'tk_rate_des'"}selected="selected"{/if} value="tk_rate_des">降序</option>
                        <option {if condition="$shoppingGuideItem['sort'] eq 'tk_rate_asc'"}selected="selected"{/if} value="tk_rate_asc">升序</option>
                        <option {if condition="$shoppingGuideItem['sort'] eq 'total_sales'"}selected="selected"{/if} value="total_sales">销量</option>
                        <option {if condition="$shoppingGuideItem['sort'] eq 'price'"}selected="selected"{/if} value="price">价格</option>
                        <option {if condition="$shoppingGuideItem['sort'] eq 'tk_total_sales'"}selected="selected"{/if} value="tk_total_sales">累计推广量</option>
                        <option {if condition="$shoppingGuideItem['sort'] eq 'tk_total_commi'"}selected="selected"{/if} value="tk_total_commi">总支出佣金</option>
                        <option {if condition="$shoppingGuideItem['sort'] eq 'tk_rate'"}selected="selected"{/if} value="tk_rate">淘客佣金比率</option>
                    </select>
                </div>
            </div>
            <!-- 图片牛皮廯 -->
            <div class="layui-form-item" style="width: 300px;">
                <label class="layui-form-label">图片牛皮廯</label>
                <div class="layui-input-block">
                    <select name="npx_level">
                        <option {if condition="$shoppingGuideItem['npx_level'] eq '1'"}selected="selected"{/if} value="1">不限</option>
                        <option {if condition="$shoppingGuideItem['npx_level'] eq '2'"}selected="selected"{/if} value="2">无</option>
                        <option {if condition="$shoppingGuideItem['npx_level'] eq '3'"}selected="selected"{/if} value="3">轻微</option>

                    </select>
                </div>
            </div>
            <!-- 淘客佣金比率 -->
            <div class="layui-form-item">
                <div class="layui-inline">
                    <label class="layui-form-label">淘客佣金比率</label>
                    <div class="layui-input-inline" style="width: 150px;">
                        <input type="text" name="start_tk_rate" value="{$shoppingGuideItem.start_tk_rate}" autocomplete="off" class="layui-input">
                    </div>
                    <div class="layui-form-mid"> - </div>
                    <div class="layui-input-inline" style="width: 150px;">
                        <input type="text" name="end_tk_rate" value="{$shoppingGuideItem.end_tk_rate}" autocomplete="off" class="layui-input">
                    </div>
                </div>
                <span>淘客佣金比率，如：1234表示12.34%</span>
            </div>
            <!-- 折扣价范围 -->
            <div class="layui-form-item">
                <div class="layui-inline">
                    <label class="layui-form-label">折扣价范围</label>
                    <div class="layui-input-inline" style="width: 150px;">
                        <input type="text" name="start_price" value="{$shoppingGuideItem.start_price}" placeholder="￥" autocomplete="off" class="layui-input">
                    </div>
                    <div class="layui-form-mid"> - </div>
                    <div class="layui-input-inline" style="width: 150px;">
                        <input type="text" name="end_price" value="{$shoppingGuideItem.end_price}" placeholder="￥" autocomplete="off" class="layui-input">
                    </div>
                </div>
                <span>单位：元</span>
            </div>
            <!-- 包邮 -->
            <div class="layui-form-item">
                <label class="layui-form-label">包邮</label>
                <div class="layui-input-block">
                    <input type="radio" name="need_free_shipment" value="false" title="不限" {if condition="$shoppingGuideItem['need_free_shipment'] eq 'false'"}checked=""{/if}>
                    <input type="radio" name="need_free_shipment" value="true" title="包邮" {if condition="$shoppingGuideItem['need_free_shipment'] eq 'true'"}checked=""{/if}>
                </div>
            </div>
            <!-- 优惠卷 -->
            <div class="layui-form-item">
                <label class="layui-form-label">优惠卷</label>
                <div class="layui-input-block">
                    <input type="radio" name="has_coupon" value="false" title="不限" {if condition="$shoppingGuideItem['has_coupon'] eq 'false'"}checked=""{/if}>
                    <input type="radio" name="has_coupon" value="true" title="优惠卷" {if condition="$shoppingGuideItem['has_coupon'] eq 'true'"}checked=""{/if}>
                </div>
            </div>
            <!-- 淘宝商品 -->
            <div class="layui-form-item">
                <label class="layui-form-label">淘宝商品</label>
                <div class="layui-input-block">
                    <input type="radio" name="is_tmall" value="false" title="不限" {if condition="$shoppingGuideItem['is_tmall'] eq 'false'"}checked=""{/if}>
                    <input type="radio" name="is_tmall" value="true" title="淘宝商品" {if condition="$shoppingGuideItem['is_tmall'] eq 'true'"}checked=""{/if}>
                </div>
            </div>
            <!-- 采集页数 -->
            <div class="layui-form-item">
                <label class="layui-form-label">采集页数</label>
                <div class="layui-input-block">
                    <input type="text" name="page_no" value="{$shoppingGuideItem.page_no}" required lay-verify="required" placeholder="必填内容" autocomplete="off" class="layui-input">
                </div>
            </div>
            <!-- 采集页数大小 -->
            <div class="layui-form-item">
                <label class="layui-form-label">页数大小</label>
                <div class="layui-input-block">
                    <input type="text" name="page_size" required lay-verify="required" placeholder="必填内容、页大小，默认20，1~100" value="{$shoppingGuideItem.page_size}" autocomplete="off" class="layui-input">
                </div>
            </div>
            <div class="layui-form-item">
                <div class="layui-input-block">
                    <button class="layui-btn" lay-submit="" lay-filter="ShoppingGuideCollectEdit">立即提交</button>
                    <button class="layui-btn layui-btn-primary"><a href="{:url('ShoppingGuideCollect/index')}">返回</a></button>
                </div>
            </div>
        </form>
    </div>
</div>
{include file="index_footer"}
<script type="text/javascript">
    layui.use(['form'],function(){
        var form = layui.form()
            ,jq = layui.jquery;

        form.on('submit(ShoppingGuideCollectEdit)', function(data){
            loading = layer.load(2, {
                shade: [0.2,'#000']
            });
            var param = data.field;
            $.ajax({
                type: 'POST',
                url: '{:url("ShoppingGuideCollect/edit")}',
                data: param,
                dataType:'json',
                success: function(data){
                    if(data.code == 200){
                        layer.close(loading);
                        layer.msg(data.msg, {icon: 1, time: 1000}, function(){
                            location.href = '{:url("ShoppingGuideCollect/index")}';
                        });
                    }else{
                        layer.close(loading);
                        layer.msg(data.msg, {icon: 2, anim: 6, time: 1000});
                    }
                },
            });
            return false;
        });
    })
</script>
</body>
</html>